package com.ruoyi.system.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

/**
 * 分销提成类型
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum BdmRoyaltyRecordEnum {


    DIRECT_PREMIUM("1","直推奖"),
    RECOMMENDED_ROOM("2","平台奖励"),
    SINGLE_PRIZE("3","单单奖"),
    AGENCY_GRADE_AWARD("4","平级奖"),
    SKIP_LEVEL_AWARD("5","跨级推奖"),
    DIVIDEND_AWARD("6","分红奖"),
    GROUP_AWARD("7","团队奖"),




    ;


    /**
     * 等级
     */
    private String type;

    /**
     * 描述
     */
    private String description;

    /**
     * 获取枚举
     * @param type
     * @return
     */
    public static BdmRoyaltyRecordEnum getEnum(String type) {
        return Stream.of(BdmRoyaltyRecordEnum.values())
                .filter(p -> p.getType().equals(type))
                .findAny()
                .orElse(null);
    }
}
